package com.kede.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kede.entity.Ctrain;
import com.kede.dao.CtrainDao;
import com.kede.service.CtrainService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 【请填写作者】
 * @since 2020-04-16
 */
@Service
public class CtrainServiceImpl extends ServiceImpl<CtrainDao, Ctrain> implements CtrainService {

    @Autowired
    CtrainDao ctrainDao;
    @Override
    public Ctrain getByMid(long mid) {
        QueryWrapper<Ctrain> Wrapper = new QueryWrapper<Ctrain>();
        Wrapper.eq("mid",mid);
        Ctrain one = ctrainDao.selectOne(Wrapper);
        return one;
    }

    @Override
    public int deleteCtrainById(Integer id) {
        return ctrainDao.deleteCtrainById(id);
    }
}
